package com.aaron.kjviewutils;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 作者：Aaron on 2017/2/16 17:34
 * 邮箱：kaijin.fang@edianniu.com
 */
public class UserPorfileActivity extends BaseActivity {

    @Bind(R.id.userToolBar)
    Toolbar userToolBar;
    @Bind(R.id.barTitle)
    TextView barTitle;
    @Bind(R.id.leftBarIcon)
    ImageView leftBarIcon;

    @OnClick(R.id.leftBarIcon)
    void leftBarIconClick()
    {
        /*if(null!=menu)
        {
            menu.showMenu(true);
        }*/
        closeSelf(UserPorfileActivity.this);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.layout_userprofile);
        ButterKnife.bind(this);
        initTitle();
    }

    private void initTitle()
    {
        userToolBar.setTitle("");
        barTitle.setText("用户中心");
        loadBackground(leftBarIcon, resources.getDrawable(R.mipmap.back));
        userToolBar.setNavigationIcon(null);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK
                && event.getAction() == KeyEvent.ACTION_DOWN)
        {
            //关闭
            closeSelf(UserPorfileActivity.this);
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}
